package com.zsh.myserver.validators;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.*;

/**
 * Copyright (C), 2020-2020
 * Author: Zhoushaohua
 * Date: 2020/4/12 16:53
 * Description: 密码校验注解
 */
@Target({ElementType.FIELD, ElementType.TYPE, ElementType.PARAMETER})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Constraint(validatedBy = PasswordValidator.class)//将注解与关联类关联起来
public @interface PasswordValid {

    int min() default 6;

    int max() default 16;

    String message() default "passwords is not valid!";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};

    //关联类PasswordValidator.class
}
